<?php

/**
 * Input7dSummaryWeather form base class.
 *
 * @method Input7dSummaryWeather getObject() Returns the current form's model object
 *
 * @package    TMD
 * @subpackage form
 * @author     Thaihosting
 */
abstract class BaseInput7dSummaryWeatherForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'DTTIME_SUMMARY'     => new sfWidgetFormInputHidden(),
      'IGEOGRAPHIC_REGION' => new sfWidgetFormInputHidden(),
      'DTSAVE_TIME'        => new sfWidgetFormInputHidden(),
      'IUSER_ID'           => new sfWidgetFormInputText(),
      'SWEATHER_TH'        => new sfWidgetFormTextarea(),
      'SWEATHER_ENG'       => new sfWidgetFormTextarea(),
      'SDOC_LINK'          => new sfWidgetFormInputText(),
      'SRAIN_TH'           => new sfWidgetFormInputText(),
      'SRAIN_ENG'          => new sfWidgetFormInputText(),
      'STEMPERATURE_TH'    => new sfWidgetFormInputText(),
      'STEMPERATURE_ENG'   => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'DTTIME_SUMMARY'     => new sfValidatorChoice(array('choices' => array($this->getObject()->getDttimeSummary()), 'empty_value' => $this->getObject()->getDttimeSummary(), 'required' => false)),
      'IGEOGRAPHIC_REGION' => new sfValidatorChoice(array('choices' => array($this->getObject()->getIgeographicRegion()), 'empty_value' => $this->getObject()->getIgeographicRegion(), 'required' => false)),
      'DTSAVE_TIME'        => new sfValidatorChoice(array('choices' => array($this->getObject()->getDtsaveTime()), 'empty_value' => $this->getObject()->getDtsaveTime(), 'required' => false)),
      'IUSER_ID'           => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'SWEATHER_TH'        => new sfValidatorString(array('max_length' => 2147483646, 'required' => false)),
      'SWEATHER_ENG'       => new sfValidatorString(array('max_length' => 2147483646, 'required' => false)),
      'SDOC_LINK'          => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'SRAIN_TH'           => new sfValidatorString(array('max_length' => 400, 'required' => false)),
      'SRAIN_ENG'          => new sfValidatorString(array('max_length' => 400, 'required' => false)),
      'STEMPERATURE_TH'    => new sfValidatorString(array('max_length' => 400, 'required' => false)),
      'STEMPERATURE_ENG'   => new sfValidatorString(array('max_length' => 400, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('input7d_summary_weather[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Input7dSummaryWeather';
  }


}
